package com.msa.msaportal.service.impl;

import java.util.List;

import com.msa.msaportal.dao.IPortalPageDao;
import com.msa.msaportal.entity.PortalExample;
import com.msa.msaportal.entity.PortalPage;
import com.msa.msaportal.entity.PortletEntity;
import com.msa.msaportal.entity.PortletViewRes;
import com.msa.msaportal.service.IPortalPageService;

public class PortalPageServiceImpl implements IPortalPageService {

	private IPortalPageDao pageDao;
	
	public IPortalPageDao getPageDao() {
		return pageDao;
	}

	public void setPageDao(IPortalPageDao pageDao) {
		this.pageDao = pageDao;
	}

	@Override
	public PortalPage addPage(PortalPage portalPage) {
		
		return pageDao.addPage(portalPage);		
	}

	@Override
	public PortalPage findById(Integer pageid) {
		// TODO Auto-generated method stub
		return pageDao.findById(pageid);
	}

	@Override
	public void updatePage(PortalPage portalPage) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public PortletEntity savePortlet(PortletEntity portletEntity) {
		// TODO Auto-generated method stub
		return pageDao.addPortlet(portletEntity);
	}

	@Override
	public List<PortletEntity> getPortletlistBypageId(Integer pageid) {
		// TODO Auto-generated method stub
		return pageDao.getPortletlistBypageId(pageid);
	}

	@Override
	public void deletePortlet(PortletEntity portlet) {
		// TODO Auto-generated method stub
		pageDao.deletePortelt(portlet);
	}

	@Override
	public PortletEntity findPortletById(Integer portletId) {
		// TODO Auto-generated method stub
		return pageDao.getPortletById(portletId);
	}

	@Override
	public void updatePortlet(PortletEntity portletEntity) {
		// TODO Auto-generated method stub
		pageDao.updatePortlet(portletEntity);
	}

	@Override
	public List<PortalPage> getPageListByPortal(PortalExample portalExample) {
		// TODO Auto-generated method stub
		return pageDao.getPagelistByPortal(portalExample);
	}

	@Override
	public PortalPage findPortalId(Integer portal_id) {
		// TODO Auto-generated method stub
		return pageDao.findPortalId(portal_id);
	}

	@Override
	public PortletViewRes findPortletRes(Integer viewId) {
		// TODO Auto-generated method stub
		return pageDao.getPortletResByid(viewId);
	}

	@Override
	public List<PortletEntity> getPortletlistByPageId(Integer pageId) {
		// TODO Auto-generated method stub
		return pageDao.getPortletlistByRoleId(pageId);
	}

	@Override
	public List<PortletEntity> getByRoleId(Integer pageId,Integer role_id) {
		// TODO Auto-generated method stub
		return pageDao.getByRoleId(pageId,role_id);
	}
	
	
}
